﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;

namespace XGameFrame.Graphic
{
    /// <summary>
    /// Abstract base class for an animated Image
    /// </summary>
    public abstract partial class ParticleEngineBase
    {
        #region Fields Region
        private Random random;
        private Vector2 emitterLocation;
        private List<ParticleBase> particles;
        private List<Texture2D> textures;
        private ContentManager content;
        #endregion

        #region Properties Region
        /// <summary>
        /// Get Engines emitterLocation or set it
        /// </summary>
        public Vector2 EmitterLocation
        {
            get { return emitterLocation; }
            set { emitterLocation = value; }
        }
        /// <summary>
        /// Get Engines particles or set it
        /// </summary>
        public List<ParticleBase> Particles
        {
            get { return particles; }
            set { particles = value; }
        }
        /// <summary>
        /// Get Engines particles graphics or set it
        /// </summary>
        public List<Texture2D> Textures
        {
            get { return textures; }
            set { textures = value; }
        }
        /// <summary>
        /// Get Engines content set it
        /// </summary>
        public ContentManager Content
        {
            get { return content; }
            set { content = value; }
        }
        /// <summary>
        /// Get Engines random set it
        /// </summary>
        public Random Random
        {
            get { return random; }
            set { random = value; }
        }
        #endregion

        #region Constructor Region
        /// <summary>
        /// Constructor for a new ParticleEngineBase which contains Particles
        /// </summary>
        /// <param name="pTextures">Textures which should be part of the particleeffect</param>
        /// <param name="pLocation">Location</param>
        public ParticleEngineBase(Vector2 pLocation)
        {
            EmitterLocation = pLocation;
            this.particles = new List<ParticleBase>();
            this.textures = new List<Texture2D>();
            random = new Random();
        }

        #endregion

        #region Abstract Methods
        /// <summary>
        /// Do Logic for AnimatedSprites
        /// </summary>
        public abstract void Update(GameTime pGameTime);

        /// <summary>
        /// Do drawings for AnimatedSprites
        /// </summary>
        /// <param name="pSpriteBatch">The graphic to draw</param>
        /// <param name="pLocation">The location where it's have to draw</param>
        public abstract void Draw(SpriteBatch pSpriteBatch);
        #endregion
    }
}
